import { default as request, cloud } from "@/framework/utils/request";

export default {
  //获取编码
  getCode(params) {
    return request({
      url: cloud.business + "/seqCode/getCode",
      method: "post",
      params: params,
    });
  },
  getEncodeGroupPage(params) {
    return request({
      url: cloud.business + "/seqCode/selectAllSeqNoDetail",
      method: "get",
      params: params,
    });
  },
  addEncode(data) {
    return request({
      url: cloud.business + "/seqCode/insertSeqNoDetail",
      method: "post",
      data,
    });
  },
  editEncode(data) {
    return request({
      url: cloud.business + "/seqCode/updateSeqNoDetail",
      method: "post",
      data,
    });
  },
  deleteEncode(data) {
    return request({
      url: cloud.business + "/seqCode/deleteSeqNoDetail?id=" + data,
      method: "post",
    });
  },
  getEncodeGroupTypePage(params) {
    return request({
      url: cloud.business + "/seqCode/selectAllSeqNoType",
      method: "get",
      params,
    });
  },
  addEncodeGroupType(data) {
    return request({
      url: cloud.business + "/seqCode/insertSeqNoType",
      method: "post",
      data,
    });
  },
  editEncodeGroupType(data) {
    return request({
      url: cloud.business + "/seqCode/updateSeqNoType",
      method: "post",
      data,
    });
  },
  deleteEncodeGroupType(data) {
    return request({
      url: cloud.business + "/seqCode/deleteSeqNoType",
      method: "post",
      params: {
        id: data,
      },
    });
  },
  fetchList(dictTypeCode) {
    return request({
      url: cloud.business + "/enum/qryEnums",
      method: "get",
      params: {
        enumTypes: dictTypeCode,
      },
    });
  },
};
